﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AppForm_Managers.Views
{
    public partial class Main_App : Form
    {
        public Main_App()
        {
            InitializeComponent();
        }

        private void ItemMenuQualification_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "QualificationForm")
                {
                    item.Activate();
                    return;
                }
            }
            QualificationForm view = new QualificationForm() { MdiParent = this };
            view.Show();
        }

        private void ItemMenuPostion_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "PositionForm")
                {
                    item.Activate();
                    return;
                }
            }
            PositionForm view = new PositionForm() { MdiParent = this };
            view.Show();
        }

        private void ItemProvince_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Location_Provinces")
                {
                    item.Activate();
                    return;
                }
            }
            Location_Provinces view = new Location_Provinces() { MdiParent = this };
            view.Show();
        }

        private void ItemDistricts_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Location_Districts")
                {
                    item.Activate();
                    return;
                }
            }
            Location_Districts view = new Location_Districts() { MdiParent = this };
            view.Show();
        }

        private void ItemCommunes_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Location_Communes")
                {
                    item.Activate();
                    return;
                }
            }
            Location_Communes view = new Location_Communes() { MdiParent = this };
            view.Show();
        }

        private void ItemOgrans_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Organizations_Form")
                {
                    item.Activate();
                    return;
                }
            }
            Organizations_Form view = new Organizations_Form() { MdiParent = this };
            view.Show();
        }

        private void ItemDeparts_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Departs_Form")
                {
                    item.Activate();
                    return;
                }
            }
            Departs_Form view = new Departs_Form() { MdiParent = this };
            view.Show();
        }

        private void ItemLocationsManager_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Location_Manager")
                {
                    item.Activate();
                    return;
                }
            }
            Location_Manager view = new Location_Manager() { MdiParent = this };
            view.Show();
        }

        private void ItemTest_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Controls_Form")
                {
                    item.Activate();
                    return;
                }
            }
            Controls_Form view = new Controls_Form() { MdiParent = this };
            view.Show();
        }

        private void ItemFamilyRelations_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "EmployeesFamilyRelations")
                {
                    item.Activate();
                    return;
                }
            }
            EmployeesFamilyRelations view = new EmployeesFamilyRelations() { MdiParent = this };
            view.Show();
        }

        private void ItemTrainningFoster_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "EmployeeTranningFosterForm")
                {
                    item.Activate();
                    return;
                }
            }
            EmployeeTranningFosterForm view = new EmployeeTranningFosterForm() { MdiParent = this };
            view.Show();
        }

        private void ItemSalaryLevel_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "SalaryLevelForm")
                {
                    item.Activate();
                    return;
                }
            }
            SalaryLevelForm view = new SalaryLevelForm() { MdiParent = this };
            view.Show();
        }

        private void ItemAddEmployees_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "EmployeesInfoBasic")
                {
                    item.Activate();
                    return;
                }
            }
            EmployeesInfoBasic view = new EmployeesInfoBasic() { MdiParent = this };
            view.Show();
        }

        private void ItemEmployeesManager_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "EmployeesManager")
                {
                    item.Activate();
                    return;
                }
            }
            EmployeesManager view = new EmployeesManager() { MdiParent = this };
            view.Show();
        }

        private void ItemEmpProfile_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "EmployeesProfile")
                {
                    item.Activate();
                    return;
                }
            }
            EmployeesProfile view = new EmployeesProfile() { MdiParent = this };
            view.Show();
        }

        private void ExportEmpInfo_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "FileExportForm")
                {
                    item.Activate();
                    return;
                }
            }
            FileExportForm view = new FileExportForm() { MdiParent = this };
            view.Show();
        }

        private void ImportEmpInfo_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "FileImportForm")
                {
                    item.Activate();
                    return;
                }
            }
            FileImportForm view = new FileImportForm() { MdiParent = this };
            view.Show();
        }

        private void ItemLocationOgrans_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Location_Manager")
                {
                    item.Activate();
                    return;
                }
            }
            Location_Manager view = new Location_Manager() { MdiParent = this };
            view.Show();
        }

        private void ItemStatisticsForm_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "StatisticsForm")
                {
                    item.Activate();
                    return;
                }
            }
            StatisticsForm view = new StatisticsForm() { MdiParent = this };
            view.Show();
        }

        private void ItemAbout_Click(object sender, EventArgs e)
        {
            AboutForm about = new AboutForm();
            about.Show();
        }

        private void ItemProcessOfWork_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Emp_RepostSalary")
                {
                    item.Activate();
                    return;
                }
            }
            Emp_RepostSalary view = new Emp_RepostSalary() { MdiParent = this };
            view.Show();
        }

        private void ItemEmpPositions_Click(object sender, EventArgs e)
        {
            foreach (var item in this.MdiChildren)
            {
                if (item.Name == "Emp_Postions")
                {
                    item.Activate();
                    return;
                }
            }
            Emp_Postions view = new Emp_Postions() { MdiParent = this };
            view.Show();
        }
    }
}